package com.huynhchihieu.domain;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the jobdetail database table.
 * 
 */
@Embeddable
public class JobdetailPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(insertable=false, updatable=false, unique=true, nullable=false)
	private int personId;

	@Column(insertable=false, updatable=false, unique=true, nullable=false)
	private int jobId;

	public JobdetailPK() {
	}
	public int getPersonId() {
		return this.personId;
	}
	public void setPersonId(int personId) {
		this.personId = personId;
	}
	public int getJobId() {
		return this.jobId;
	}
	public void setJobId(int jobId) {
		this.jobId = jobId;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof JobdetailPK)) {
			return false;
		}
		JobdetailPK castOther = (JobdetailPK)other;
		return 
			(this.personId == castOther.personId)
			&& (this.jobId == castOther.jobId);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.personId;
		hash = hash * prime + this.jobId;
		
		return hash;
	}
}